<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0043)http://localhost:8080/mango/cart/list.jhtml -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>购物车</title>

<link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css"/>
<link href="${pageContext.request.contextPath}/css/cart.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/tit.ico" type="image/x-icon" />

</head>
<body>
<div class="container header">
	<div class="span5">
		<div class="logo">
			<a href="http://localhost:8080/mango/">
				<img src="${pageContext.request.contextPath}/image/r___________renleipic_01/logo2.gif" alt="seven商城"/>
			</a>
		</div>
	</div>
	<div class="span9">
<div class="headerAd">
					<img src="${pageContext.request.contextPath}/image/header.jpg" width="320" height="50" alt="正品保障" title="正品保障"/>
</div>	</div>
	
	<%@ include file="menu.jsp" %>
	
</div>	
  <%--如果购物项这个单例集合中有值，就说明购物车中有信息，显示购物车信息 --%>	
  <s:if test="#session.cart.cartItems.size()>0">
   <div class="container cart">
		<div class="span24">
			<div class="step step1">
				
			<span style="line-height:60px; font-size:15px; font-weight:bold;">购物车信息</span>
			</div>
				<table>
					<tbody>
					 <tr>
						<th>图片</th>
						<th>商品</th>
						<th>价格</th>
						<th>数量</th>
						<th>小计</th>
						<th>操作</th>
					 </tr>
					  <s:iterator var="c" value="#session.cart.cartItems">
						<tr>
							<td width="60">
								<input type="hidden" name="id" value="22"/>
								<img src="${pageContext.request.contextPath}/${c.product.image}"/>
							</td>
							<td>
								<a target="_blank">${c.product.pname}</a>
							</td>
							<td>
								￥${c.product.shop_price}
							</td>
							<td class="quantity" width="60">
								${c.count}
							</td>
							<td width="140">
								<span class="subtotal">￥${c.subtotal}</span>
							</td>
							<td>
								<a href="${pageContext.request.contextPath}/cart_removeCart?pid=${c.product.pid}" class="delete">删除</a>
							</td>
						</tr>
					</s:iterator>	
				</tbody></table>
				<dl id="giftItems" class="hidden" style="display: none;">
				</dl>
				<div class="total">
					<em id="promotion"></em>
							<em>
								登录后确认是否享有优惠
							</em>
					<%--赠送积分: <em id="effectivePoint">596</em> --%>

					    商品金额: <strong id="effectivePrice">￥${cart.total}元</strong>  
				
				
				</div>

				<div class="bottom">
					<a href="${pageContext.request.contextPath}/cart_clearCart" id="clear" class="clear">清空购物车</a>
					<a href="${pageContext.request.contextPath}/order_saveOrder" id="submit" class="submit">提交订单</a>
				</div>
			  	
		</div>
	  </div>
	</s:if>	
	<s:else>
	  <div style="text-align: center;">
	   <span><img src="${pageContext.request.contextPath}/images/cry.gif" width="100" height="100"/></span>
	   <span style="font-size: 20px;">
	                  亲，购物车中空空如也，赶紧去商城购物吧
	                  去首页看看？<a href="${pageContext.request.contextPath}/index">点击跳转</a>
	   </span>
	  </div>
	</s:else>
 <%@ include file="bottom.jsp" %>

</body>
</html>
